//
//  ToolTipView.m
//  Details
//
//  Created by 1 1 on 15/12/10.
//  Copyright © 2015年 Hiccup. All rights reserved.
//

#import "ToolTipView.h"

@implementation ToolTipView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        UIButton * button = [UIButton buttonWithType:UIButtonTypeSystem];
        button.frame = self.frame;
        button.backgroundColor = [UIColor blackColor];
        button.alpha = 0.5;
        [self addSubview:button];
        
        UIView * vi = [[UIView alloc] initWithFrame:CGRectMake([UIScreen mainScreen].bounds.size.width/2-265/2, [UIScreen mainScreen].bounds.size.height/2-165/2, 251, 95)];
        
        UIImageView * image = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 251, 95)];
        image.image = [UIImage imageNamed:@"tool_bg.png"];
        [vi addSubview:image];
        
        UILabel * la = [[UILabel alloc] initWithFrame:CGRectMake(61, 18, 128, 21)];
        la.text = @"确定取消维修订单?";
        la.textAlignment = NSTextAlignmentCenter;
//        la.textColor = [UIColor redColor];
        la.font = [UIFont systemFontOfSize:14.0];
        [vi addSubview:la];
        
        UIButton * cancelBtn = [UIButton buttonWithType:UIButtonTypeSystem];
        cancelBtn.frame = CGRectMake(0, 61, 125, 35);
        [cancelBtn setTintColor:[UIColor colorWithRed:38/255.0 green:38/255.0 blue:38/255.0 alpha:1]];
        [cancelBtn setTitle:@"取消" forState:UIControlStateNormal];
        cancelBtn.titleLabel.font = [UIFont systemFontOfSize:12.0];
        [cancelBtn addTarget:self action:@selector(cancel) forControlEvents:UIControlEventTouchUpInside];
        [vi addSubview:cancelBtn];

        UIButton * confirmBtn = [UIButton buttonWithType:UIButtonTypeSystem];
        confirmBtn.frame = CGRectMake(126, 61, 125, 35);
        [confirmBtn setTintColor:[UIColor redColor]];
        [confirmBtn setTitle:@"确认" forState:UIControlStateNormal];
        confirmBtn.titleLabel.font = [UIFont systemFontOfSize:12.0];
        [confirmBtn addTarget:self action:@selector(confirm) forControlEvents:UIControlEventTouchUpInside];
        [vi addSubview:confirmBtn];
        
        UIView * vi1 = [[UIView alloc] initWithFrame:CGRectMake(0, 60, 251, 1)];
        vi1.backgroundColor = [UIColor colorWithRed:150/255.0 green:150/255.0 blue:150/255.0 alpha:1];
        [vi addSubview:vi1];
        
        UIView * vi2 = [[UIView alloc] initWithFrame:CGRectMake(125, 60, 1, 35)];
        vi2.backgroundColor = [UIColor colorWithRed:150/255.0 green:150/255.0 blue:150/255.0 alpha:1];
        [vi addSubview:vi2];
        
        [self addSubview:vi];

    }
    return self;
}

//取消按钮
- (void)cancel {
    [self removeFromSuperview];
}


//确认按钮
- (void)confirm {
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
